package com.example.kotlin

// 定义一个类
class Person1(val name: String, var age: Int) {
    // 成员函数
    fun greet() {
        println("Hello, my name is $name and I am $age years old.")
    }
}

fun main() {
    // 创建对象
    val person = Person1("Alice", 30)
    person.greet()  // 输出：Hello, my name is Alice and I am 30 years old.
}
